package com.angel.interfaces.config;

import com.angel.infrastructure.common.ResultBody;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;



/*
 * 更新关注微信公众号： 为了offer
 * @author parkin
 * @description
 * @date 2021/11/13
 */
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

    /*@ExceptionHandler(NullPointerException.class)
    public ResultBody nullException(NullPointerException exception) {
        log.info("空指针异常", exception);
        return ResultBody.SYSTEM_FAIL;
    }
*/
    @ExceptionHandler(Exception.class)
    public ResultBody systemException(Exception exception) {
        log.error("system error!,this error is {}", exception);
        return ResultBody.SYSTEM_FAIL;
    }
}
